//Binary tree header file
//Some code ripped from example files

#pragma once
#include <iostream>
#include <string>
#include <math.h>
#include "BinaryNode.h"
using namespace std;

class BinaryTree
{
private:

	BinaryNode* root; //Root binary node pointer

	void prstringPreorder2(BinaryNode* node);
	void prstringPostorder2(BinaryNode* node);
	void prstringInorder2(BinaryNode* node);
	void removeNode(string target, BinaryNode* current, BinaryNode** currentPtr);
	void insert(string data, BinaryNode* current);
	void insert(BinaryNode* added, BinaryNode* current);
	BinaryNode* getLowest(BinaryNode* current);

public:

	BinaryTree();
	BinaryTree(string item);

	BinaryTree(const BinaryTree& other);
	BinaryTree& operator=(const BinaryTree& other);

	BinaryTree(BinaryTree* bt1Ptr, BinaryTree* bt2Ptr);
	BinaryNode* getRoot() const;
	void setRoot(BinaryNode* r);

    string ToTree();

    void prstringPreorder();
    void prstringPostorder();
	void prstringInorder();
    bool naivefind(string target);
	
	void insert(string data);
	void insert(BinaryNode* added);
	int stringToInt(string s);
	void removeNode(string target);
	BinaryNode* getLowest();
	~BinaryTree();
};